package com.interview.item.javabase.arrays;

import java.util.ArrayList;

/**
 * @Author:zxh
 * @Description: 集合A数据 复制到集合B中
 * @Date: 2020/5/22
 * @Modified By:
 */
public class ArraysCopyTo {
    public static void main(String[] args) {
        ArrayList<String> arrayListOne = new ArrayList<>();
        arrayListOne.add("one");
        arrayListOne.add("two");

        ArrayList<String> arrayListTwo = new ArrayList<>();
        arrayListTwo.add("one1");
        arrayListTwo.add("one2");
        arrayListTwo.clear();
        arrayListTwo.addAll(arrayListOne);
        System.out.println("输出："+arrayListTwo.toString());
    }
}
